package com.translate.web.dao;
import java.math.BigDecimal;
import java.util.List;

import com.dao.base.IBaseMapper;
import com.translate.entity.Order;
import com.translate.entity.PayManager;

public interface PayManagerMapper extends IBaseMapper<PayManager> { 

	/**
	 * 取消订单
	 * @param managerId
	 * @param userId
	 * @return
	 */
	int cancelOrder(int managerId, int userId);

	int cancelTicket(int userId);
	/**
	 * 计算团队金额
	 * @param teamId
	 * @return
	 */
	BigDecimal sumPriceByTeam(int teamId);
	
	/**
	 * 余额支付统计金额
	 * @param teamId
	 * @return
	 */
	
	BigDecimal sumPriceByRechargePay(int teamId);
	
	
	/**
	 * 根据id 及 团队id 获取数据
	 * @param id
	 * @param teamId
	 * @return
	 */
	PayManager getDataByIdAndTeamId(int id, int teamId);
	
	/**
	 * 取消订单
	 * @param managerId
	 * @param userId
	 * @return
	 */
	int cancelOrderByTeam(int managerId, int teamId);
	
	/**
	 * 根据参数 获取 数据
	 * @param <P>
	 * @param param
	 * @return
	 */
	<P> PayManager getPayManagerByP(P param);
	
	/**
	 * 根据参数 获取团队 数据
	 * @param <P>
	 * @param param
	 * @return
	 */
	<P> PayManager getPayManagerByTeam(P param);
	
	/**
	 * 团长支付成功
	 * @param <P>
	 * @param behaviorRequestParam
	 * @return
	 */
	<P> int paySuccessByTeam(P behaviorRequestParam);
	
	/**
	 * 支付成功
	 * @param <P>
	 * @param param
	 * @return
	 */
	<P> int  paySuccess(P param);
	
	/**
	 * 待确认
	 * @param behaviorRequestParam
	 * @return
	 */
	<P> int toBeConfirmed(P behaviorRequestParam);
	
	/**
	 * 待确认
	 * @param behaviorRequestParam
	 * @return
	 */
	<P> int toBeConfirmedByTeam(P behaviorRequestParam);
	
	
	/**
	 * 获取金额
	 * @param id
	 * @return
	 */
	PayManager selectMoney(int id);

	List<Order> getOrdersByPayManagerIdAndPayType(int payManagerId, int userId);
}
